{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "35f820ec",
   "metadata": {},
   "source": [
    "# 题目一\n",
    " 有一个这样的DNA核酸序列“AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC”， 请把这个核酸序列存入一个list，并数一数A、G、C、T各有多少个。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "a004d22a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the number of A is: 20\n",
      "the number of G is: 17\n",
      "the number of C is: 12\n",
      "the number of T is: 21\n"
     ]
    }
   ],
   "source": [
    "a='AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC'\n",
    "al=list(a)\n",
    "def num(li):\n",
    "    A_num=0;G_num=0;C_num=0;T_num=0\n",
    "    for i in li:\n",
    "        if i=='A':\n",
    "            A_num+=1 \n",
    "        elif i=='G':\n",
    "            G_num+=1 \n",
    "        elif i=='C':\n",
    "            C_num+=1 \n",
    "        else: T_num+=1 \n",
    "    print(\"the number of A is:\",A_num)\n",
    "    print(\"the number of G is:\",G_num)\n",
    "    print(\"the number of C is:\",C_num)\n",
    "    print(\"the number of T is:\",T_num)\n",
    "\n",
    "num(al)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "91bd5d4f",
   "metadata": {},
   "source": [
    "# 题目二\n",
    "一个花样滑冰运动员表演后，裁判给表演内容进行评分，分数从0.25分到10分，每次增加值为0.25分。\n",
    "试生成一个元组，把可能的得分存入元组，并遍历元组的每一项，打印“一个运动员可能得_____分”。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "67f802ad",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "一个运动员可能得0.25分\n",
      "一个运动员可能得0.50分\n",
      "一个运动员可能得0.75分\n",
      "一个运动员可能得1.00分\n",
      "一个运动员可能得1.25分\n",
      "一个运动员可能得1.50分\n",
      "一个运动员可能得1.75分\n",
      "一个运动员可能得2.00分\n",
      "一个运动员可能得2.25分\n",
      "一个运动员可能得2.50分\n",
      "一个运动员可能得2.75分\n",
      "一个运动员可能得3.00分\n",
      "一个运动员可能得3.25分\n",
      "一个运动员可能得3.50分\n",
      "一个运动员可能得3.75分\n",
      "一个运动员可能得4.00分\n",
      "一个运动员可能得4.25分\n",
      "一个运动员可能得4.50分\n",
      "一个运动员可能得4.75分\n",
      "一个运动员可能得5.00分\n",
      "一个运动员可能得5.25分\n",
      "一个运动员可能得5.50分\n",
      "一个运动员可能得5.75分\n",
      "一个运动员可能得6.00分\n",
      "一个运动员可能得6.25分\n",
      "一个运动员可能得6.50分\n",
      "一个运动员可能得6.75分\n",
      "一个运动员可能得7.00分\n",
      "一个运动员可能得7.25分\n",
      "一个运动员可能得7.50分\n",
      "一个运动员可能得7.75分\n",
      "一个运动员可能得8.00分\n",
      "一个运动员可能得8.25分\n",
      "一个运动员可能得8.50分\n",
      "一个运动员可能得8.75分\n",
      "一个运动员可能得9.00分\n",
      "一个运动员可能得9.25分\n",
      "一个运动员可能得9.50分\n",
      "一个运动员可能得9.75分\n",
      "一个运动员可能得10.00分\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "score=np.arange(0.25,10.25,0.25)\n",
    "score_tuple=tuple(score)\n",
    "for i in range(len(score_tuple)):\n",
    "    print('一个运动员可能得%0.2f分'%score_tuple[i])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7e8ebc13",
   "metadata": {},
   "source": [
    "# 题目三\n",
    "创建一个字典，列出你所了解的地域美食，比如{'肠粉':{'城市':'广州','原料':'米'}}。当然，你可以做的更丰富一些。 \n",
    "最后遍历你熟悉的美食，打印出，类似如下的句子：“肠粉是广州的一种美食，它的主要原料是米”。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "ad9d3f32",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "肠粉是广州的一种美食,它的主要原料是米；\n",
      "煎饼果子是天津的一种美食,它的主要原料是绿豆面粉；\n",
      "菜煎饼是滕州的一种美食,它的主要原料是蔬菜；\n",
      "杂粮煎饼是泰安的一种美食,它的主要原料是杂粮面粉；\n"
     ]
    }
   ],
   "source": [
    "food_dict={'肠粉':{'城市':'广州','原料':'米'},'煎饼果子':{'城市':'天津','原料':'绿豆面粉'},\n",
    "           '菜煎饼':{'城市':'滕州','原料':'蔬菜'},'杂粮煎饼':{'城市':'泰安','原料':'杂粮面粉'}}\n",
    "for food_name,food_info in food_dict.items():\n",
    "    print('%s是%s的一种美食,它的主要原料是%s；'%(food_name.title(),food_info['城市'],food_info['原料']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "32e7879b",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
